<template>
	<div id="app">
		<el-container>
			<el-header>
				<img src="~@/assets/logo.png" class="he__logo" alt="" />
				<img src="~@/assets/logotext.png" class="he__logotext" alt="" />
			</el-header>
			<el-container class="con" style="height: calc(100vh - 113px);">
				<el-aside>
					<div class="cz">
						<div class="cz__item">
							<div class="cz__item__label">显示：</div>
							<el-checkbox v-model="checked">图片</el-checkbox>
						</div>
						<div class="cz__item">
							<div class="cz__item__label">显示图：</div>
							<el-checkbox v-model="checked">显示停用</el-checkbox>
						</div>
					</div>
					<div class="lefttop">
						<img src="~@/assets/fenlei.png" class="lefttop__icon" alt="" />
						无分类
					</div>
					<el-menu :default-openeds="[]" text-color='#4E6781' active-text-color='#4A77F6'>
						<el-submenu v-for="(item,index) in mulist" :key="index" :index='index'>
							<template slot="title">
								<div class="el-submenu-title-1">
									<div class="dian" :class="curindex===index?'active':''"></div>{{item.title}}
								</div>
							</template>
							<el-submenu popper-class='sub' v-for="(item1,index1) in item.list" :key="index+'-'+index1"
								:index="index+'-'+index1">
								<template slot="title">
									<div class="el-submenu-title-1 el-submenu-title-2">
										<div class="dian1"></div>{{item1.title}}
									</div>
								</template>
								<el-menu-item :key="index+'-'+index1+'-'+index2" :index="index+'-'+index1+'-'+index2"
									v-for="(item2,index2) in item1.list"
									@click="curindex=index">{{item2.title}}</el-menu-item>
							</el-submenu>
						</el-submenu>
					</el-menu>
				</el-aside>
				<el-main>
					<div class="mian__top" ref="mian__top">
						<el-button v-for='(item,index) in btnlist' :key="index"
							:style="{color:item.color,background:item.bgcolor}">{{item.text}}</el-button>
					</div>
					<div class="mian__box" :style="{height:`calc(100% - 30px - ${mainTopheight}px)`}">
						<router-view></router-view>
					</div>
				</el-main>
			</el-container>
		</el-container>

	</div>
</template>
<script>
	export default {
		data() {
			return {
				btnlist: [{
						text: '增加',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '复制',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '修改',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '删除',
						bgcolor: '#ececec',
						color: '#4E6781'
					}, {
						text: '保存',
						bgcolor: '#ececec',
						color: '#4E6781'
					}, {
						text: '放弃',
						bgcolor: '#ececec',
						color: '#4E6781'
					}, {
						text: '刷新',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '打印',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '输出',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '列项',
						bgcolor: '#dbe4fd',
						color: '#231918'
					},
					{
						text: '导入',
						bgcolor: '#ececec',
						color: '#4E6781'
					},
					{
						text: '导出',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '过滤',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '字母',
						bgcolor: '#ececec',
						color: '#4E6781'
					}, {
						text: '图片',
						bgcolor: '#dbe4fd',
						color: '#231918'
					}, {
						text: '返回',
						bgcolor: '#dbe4fd',
						color: '#231918'
					},
				],
				mulist: [{
					title: '10.销售品',
					list: [{
						title: '销售品1',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品2',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品3',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}]
				}, {
					title: '20.材料(制单)',
					list: [{
						title: '销售品1',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品2',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品3',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}]
				}, {
					title: '30.材料(往来)',
					list: [{
						title: '销售品1',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品2',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品3',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}]
				}, {
					title: '40.本厂裁片',
					list: [{
						title: '销售品1',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品2',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品3',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}]
				}, {
					title: '60.其他',
					list: [{
						title: '销售品1',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品2',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}, {
						title: '销售品3',
						list: [{
							title: '织带'
						}, {
							title: '飘带'
						}, {
							title: '肩带'
						}, ]
					}]
				}],
				curindex: '',
				mainTopheight:0
			}
		},
		mounted() {
			// let height = this.$refs.mian__top.offsetHeight; //100
			this.mainTopheight=this.$refs.mian__top.offsetHeight
			let _this=this
			window.onresize = function() {
				_this.mainTopheight=_this.$refs.mian__top.offsetHeight
				// console.log(height)
			};
			
		},

	}
</script>
<style lang="scss" scoped>
	* {
		padding: 0;
		margin: 0;
	}

	.el-header {
		background-color: #fff;
		height: 111px !important;
		display: flex;
		align-items: center;
		border-bottom: 2px solid #EFEFEF;
		padding-left: 43px;
		.he__logo {
			width: 64px;
			height: 53px;
			// margin-left: 43px;
			margin-right: 5px;
		}

		.he__logotext {
			width: 138px;
			height: 32px;
		}
	}

	.el-aside {
		background-color: #fff;
		width: 350px !important;
		border-right: 2px solid #EFEFEF;
	}

	.el-main {
		padding: 0 !important;
		background-color: #f1f4f6;
	}

	.con {}

	.dian {
		width: 9px;
		height: 9px;
		border-radius: 50%;
		border: 3px solid #4A77F6;
		margin-right: 25px;
		justify-content: center;
		opacity: 0.39;
	}

	.el-submenu-title-1 {
		display: flex;
		align-items: center;
		font-size: 19px;
		padding-left: 20px;
	}

	.dian1 {
		width: 8px;
		height: 8px;
		background: #4E6781;
		border-radius: 4px;
		opacity: 0.5;
		margin-right: 5px;

	}

	.el-submenu .el-menu-item {
		font-size: 16px;
		padding-left: 90px !important;
	}

	.active {
		opacity: 1;
	}

	.lefttop {
		// width: 350px;
		height: 61px;
		background: #4A77F6;
		display: flex;
		align-items: center;
		font-family: Alibaba PuHuiTi;
		font-weight: 400;
		font-size: 21px;
		color: #FFFFFF;

		&__icon {
			width: 30px;
			height: 30px;
			margin-left: 44px;
			margin-right: 17px;
		}
	}

	.cz {
		padding: 27px 40px 0;

		&__item {
			display: flex;
			align-items: center;
			font-family: Alibaba PuHuiTi;
			font-weight: 400;
			font-size: 17px;
			color: #1E173C;
			line-height: 17px;
			margin-bottom: 25px;

			&__label {

				width: 92px;
			}
		}
	}

	.el-button+.el-button {
		margin-left: 2px;
	}

	.mian__top {
		background-color: #fff;
		padding-bottom: 5px;
	}

	.mian__box {
		width: calc(100% - 30px);
		padding: 15px;
	}


	/* 隐藏 Chrome、Safari 和 Opera 的滚动条 */
	.el-aside::-webkit-scrollbar {
		display: none;
	}

	/* 隐藏 IE、Edge 和 Firefox 的滚动条 */
	.el-aside {
		-ms-overflow-style: none;
		/* IE and Edge */
		scrollbar-width: none;
		/* Firefox */
	}
</style>